package com.kaifamiao.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;
import java.util.logging.Logger;

public class LocalDateConverter implements Converter<String, LocalDate> {

    @Autowired
    private Logger logger;

    @Override
    public LocalDate convert(String source) {
        logger.info( "将" + source + "解析为 LocalDate" );
        return LocalDate.parse( source );
    }

}
